# Maintainer: Jonathan Sieber <mail@strfry.org>
pkgname=toxcore
pkgver=0.2.12
pkgrel=0
pkgdesc="Tox communication project - Core Library"
url="https://tox.chat/"
arch="all"
license="GPL-3.0-or-later"
makedepends="linux-headers cmake libsodium-dev opus-dev libvpx-dev"
subpackages="$pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/TokTok/c-toxcore/archive/v$pkgver.tar.gz"

# Toxcore's tests do require networking and are not working properly in Travis-CI
options="!check"

builddir="$srcdir/c-$pkgname-$pkgver"

build() {
	cmake . \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_LIBDIR=lib

	make
}

check() {
	make test
}

package() {
	make DESTDIR="$pkgdir" install
	rm -f "$pkgdir"/usr/lib/*.a
}

sha512sums="c22f139cfff3a5aedf5fb08c33cae0dae3d6fbceec87867c81290e3bf9d2e13466a0e2bad8378a7a7ba1e9b7b9ad756712963461ae248102e4cab7d4691228d8  toxcore-0.2.12.tar.gz"
